Skip to content

(feat) O3-4201: Enhance Number Question Labels Display Unit and Range (Min/Max) from Concept #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

D-matz
Copy link

@D-matz D-matz commented Dec 21, 2024

Add (unit) (min-max) to label, validate input against concept min/max

https://openmrs.atlassian.net/browse/O3-4201

Related: https://openmrs.atlassian.net/browse/O3-4122

4122 also suggests a warning for values within the absolute range but outside normal or critical range. Looking for suggestions on how to implement that, and how to add a test case for a concept with units and min/max

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

Related Issue

Other

@D-matz
Copy link
Author

D-matz commented Dec 21, 2024

@samuelmale @ibacher please let me know if you had other approaches in mind for this or issues
lower
within

greater

Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some test coverage asserting that the units and labels are incorporated in the label?

D-matz added 2 commits March 8, 2025 12:17
…ber-Question-Labels-Display-Unit-and-Range-(Min/Max)-from-Concept
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really sure about jest.mock('react-i18next', () => ({...
it seemed needed for the new i18n label t('{{fieldDescription}} {{unitsAndRange}}'... but I'm not sure if that's correct

Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@D-matz can you resolve the lint issues and merge conflicts and we have this merged in?

@D-matz
Copy link
Author

D-matz commented May 21, 2025

@samuelmale by the way, I had to add i18n usetranslation to unspecified.test.tsx and form-engine.test.tsx which I am not sure about, for those tests to pass. Also note I have 9 failing tests on yarn test on both this branch and main. So please let me know if I'm doing something wrong with these.

@samuelmale
Copy link
Member

samuelmale commented Jun 9, 2025

@D-matz, I added a couple of fixes: D-matz#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants